/**
 * @author harry
 * @date 2022/2/23/21:21
 */

package com.serviceOrchestration.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.serviceOrchestration.util.Role;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
public class User extends Account{

    private String name;
    private int balance;
    /**
     * 地域
     */
    private String area;
    /**
     * 证件有效期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date validity;
    /**
     * 身份标签
     */
    @JsonIgnore
    private String label;

    public User() {
        this.role = Role.USR;
    }

    @Override
    public String toString() {
        return "User{" +
                "id='" + id + '\'' +
                ", password='" + password + '\'' +
                ", role='" + role + '\'' +
                ", name='" + name + '\'' +
                ", balance=" + balance +
                ", area='" + area + '\'' +
                ", validity=" + validity +
                ", label='" + label + '\'' +
                '}';
    }
}
